/*
 *  POJ1321: 棋盘问题
 */

/*-------- Includes --------*/
#include <iostream>

using namespace std;

/*-------- Types --------*/

/*-------- Global Variables --------*/
int  N, K;          // N: scale of chessboard, K: number of chess pieces
int  nSolu;         // number of solutions
char board[8][12];  // chessboard

/*-------- Function Prototypes --------*/
void dfs(int r, int k); // r: r-th row, k: remain k chess pieces

/*-------- Main Function --------*/
int main(int argc, char const *argv[])
{
    while (cin >> N >> K && N != -1) {
        // get chessboard
        for (int i = 0; i < N; i++)
            cin >> board[i];

        nSolu = 0;

        dfs(0, K);

        cout << nSolu << endl;
    }

    return 0;
}

/*-------- Functions --------*/
void dfs(int r, int k)
{
    // base case: finish K chess pieces
    if (k == 0) {
        nSolu++;
        return;
    }

    // cut off: number of remaining blank rows must greater than or equal to k
    if (N - r < k) return;

    // skip this row: put no chess piece at this row
    dfs(r + 1, k);

    // put one chess at this row
    for (int i = 0; i < N; i++) {
        // cut off: must be '#'
        if (board[r][i] == '.') continue;

        bool fine = true;

        for (int j = 0; j < r; j++) {
            if (board[j][i] == '*') {
                fine = false;
                break;
            }
        }

        if (fine) {
            board[r][i] = '*';  // mark the board with star(*)
            dfs(r + 1, k - 1);
            board[r][i] = '#';  // revert for backtracing
        }
    }
}
